package cn.smbms.tools;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ConfigManager {
	private static ConfigManager configManager;
	private static Properties properties;

	private ConfigManager() {
		String context = "database.properties";
		properties = new Properties();
		InputStream is = ConfigManager.class.getClassLoader()
				.getResourceAsStream(context);
		try {
			properties.load(is);
			is.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	/**
	 * 静态内部类
	 */
	public static class ConfigMang {
		private static final ConfigManager CONFIGMAGAGER = new ConfigManager();
	}

	public static ConfigManager getConfigManager() {
		configManager = ConfigMang.CONFIGMAGAGER;
		return configManager;
	}
  
	public String getValus(String Key) {
		return properties.getProperty(Key);

	}

}
